﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="insertQuyen.ascx.cs" Inherits="UserControl_Role_insertQuyen" %>
<table cellspacing="0" cellpadding="2" width="100%" class="cssTable" >
    <tr>
		<td align="left" class="HeadingTree" colSpan="6">Nhóm quyền</td>
	</tr>
	<tr>
		<td colSpan="6">
		    <asp:validationsummary id="vdsQuyen" runat="server" CssClass="cssManField" Font-Bold="True" />
		    <asp:label id="lblMess" runat="server" CssClass="cssManField" />
		</td>
	</tr>
	<tr>
		<td align="right" style="width:10%;">
		    <asp:label id="lblNhomID" runat="server" CssClass="cssManField" Text="<U>N</U>hóm cha:" />
		</td>
		<td style="width:33%;">
		    <asp:DropDownList id="ddlNhomID" runat="server" Width="60%" Enabled="False" />
		    <asp:checkbox id="cbNhomID" runat="server" AutoPostBack="True" Text="Không có nhóm cha" OnCheckedChanged="cbNhomID_CheckedChanged" Checked="True" />
		</td>
		<td align="right" style="width:8%;">
		    <asp:label id="lblTennhom" runat="server" CssClass="cssManField" Text="<U>T</U>ên nhóm:" />
		</td>
		<td style="width:18%;">
		    <asp:textbox id="txtTennhom" accessKey="t" runat="server"  Width="98%" MaxLength="50" />
		</td>
		<td style="width:5%;">
		    <asp:customvalidator id="ctvTennhom" runat="server" Display="Static" ErrorMessage="Bạn phải nhập tên nhóm" ControlToValidate="txtTennhom" Text="*" />
		</td>
		<td width="23%">
		    <asp:button id="btnInsert" accessKey="c" runat="server" CssClass="cssButton" Width="98px" Text="Tạo mới(c)" OnClick="btnInsert_Click" />&nbsp;
		    <asp:button id="btnCancel" accessKey="r" runat="server" CssClass="cssButton" Width="98px" Text="Ðặt lại(r)" OnClick="btnCancel_Click" />
		</td>
	</tr>
	<tr>
		<td align="center" valign="top" colspan="6" style="height:524px;">
		    <asp:GridView id="ddlQuyen" runat="server" Width="100%" CellPadding="0" CellSpacing="0" 
		        AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="ID" 
		        HeaderStyle-CssClass="cssGridHeader" EditRowStyle-CssClass="cssGridEdit" RowStyle-CssClass="cssGridCell"
		        AlternatingRowStyle-CssClass="cssGridAlterCell"  
                PagerStyle-CssClass="cssGridPager" SelectedRowStyle-CssClass="cssSelectedRow"
		        OnRowCancelingEdit="ddlQuyen_RowCancelingEdit" OnRowDataBound="ddlQuyen_RowDataBound" 
		        OnRowDeleting="ddlQuyen_RowDeleting" OnRowEditing="ddlQuyen_RowEditing" 
                OnRowUpdating="ddlQuyen_RowUpdating" 
                onpageindexchanging="ddlQuyen_PageIndexChanging">
                <RowStyle CssClass="cssGridCell"></RowStyle>
                <PagerSettings Position="TopAndBottom" />
				<Columns>
					<asp:TemplateField Visible="False">
						<ItemTemplate>
							<asp:Label id="lblID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ID") %>' />
						</ItemTemplate>
					</asp:TemplateField>
					<asp:BoundField DataField="Seq" ReadOnly="True" HeaderText="TT">
						<ItemStyle HorizontalAlign="Right" Width="4%"></ItemStyle>
					</asp:BoundField>
					<asp:TemplateField HeaderText="Nhóm cha">
						<ItemTemplate>
						    <asp:Label id="lblNhomIDGVCheck" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.NhomID") %>' ToolTip='<%# DataBinder.Eval(Container, "DataItem.ParentName") %>' />
						</ItemTemplate>
						<EditItemTemplate>
							<asp:DropDownList id="ddlNhomIDGV" Width="75%" runat="server"  />
							<asp:CheckBox id="cbNhomIDGV" runat="server" Text="Không có nhóm cha" OnCheckedChanged="cbNhomIDGV_CheckedChanged" AutoPostBack="True"  ToolTip='<%#DataBinder.Eval(Container, "RowIndex")%>' ></asp:CheckBox>
							<asp:Label id="lblNhomIDGV" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.NhomID") %>' Width="100%"  />
						</EditItemTemplate>
						<ItemStyle HorizontalAlign="Left" />
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Tên nhóm">
						<ItemTemplate>
							<asp:Label id="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Tennhom") %>' />
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id="Textbox1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Tennhom") %>' Width="100%"  />
						</EditItemTemplate>
                        <ItemStyle HorizontalAlign="Left" />
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Sửa" HeaderStyle-HorizontalAlign="Center">

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

						<ItemStyle HorizontalAlign="Center" Width="8%"></ItemStyle>
						<ItemTemplate>
							<asp:ImageButton id="lbtEdit" runat="server" ImageUrl="~/images/Button/Edit.gif" ToolTip="Sửa mục từ" CommandName="Edit" />
						</ItemTemplate>
						<EditItemTemplate>
							<asp:ImageButton id="lbtUpdate" runat="server" ImageUrl="~/images/Button/Update.gif" ToolTip="Cập nhật bản ghi" CommandName="Update" />&nbsp;
							<asp:ImageButton id="lbtCancel" runat="server" ImageUrl="~/images/Button/Cancel.gif" ToolTip="Thôi" CommandName="Cancel" />
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Xóa" HeaderStyle-HorizontalAlign="Center">

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

						<ItemStyle HorizontalAlign="Center" Width="8%"></ItemStyle>
						<ItemTemplate>
							<asp:ImageButton id="lbtDelete" runat="server" ImageUrl="~/images/Button/Delete.gif" ToolTip="Xóa bản ghi" CommandName="Delete" />
						</ItemTemplate>
					</asp:TemplateField>
				</Columns>

<PagerStyle CssClass="cssGridPager" HorizontalAlign="Center"></PagerStyle>

<SelectedRowStyle CssClass="cssSelectedRow"></SelectedRowStyle>

<HeaderStyle CssClass="cssGridHeader"></HeaderStyle>

<EditRowStyle CssClass="cssGridEdit"></EditRowStyle>

<AlternatingRowStyle CssClass="cssGridAlterCell"></AlternatingRowStyle>
			</asp:GridView>
		</td>
	</tr>
</TABLE>
<input id="hdNhomIDID" type="hidden" name="hdNhomIDID" runat="server">
